/**
 * @author rain-falling-cold-s
 **/
package org.Set.TreeSet;

import java.util.Iterator;
import java.util.Set;
import java.util.TreeSet;

public class TreeSetDemo {
    public static void main(String[] args) {
        Set<Integer> collection1 = Set.of(10, 15, 18, 8, 56, 41);
        TreeSet<Integer> tree = new TreeSet<Integer>(collection1);

//        Iterator<Integer> treeSet = new Iterator<Integer>() {
//            @Override
//            public boolean hasNext() {
//                return false;
//            }
//
//            @Override
//            public Integer next() {
//                return null;
//            }
//        };
        Iterator<Integer> treeSet = tree.iterator();
        for (; treeSet.hasNext(); ) {
            System.out.print(treeSet.next().toString() + " ");
        }
    }
}
